/**
 * Created with IntelliJ IDEA.
 * Description:
 * https://gitee.com/li--jiaqiang/java-test.git
 * git pull
 * git pull origin master
 * git pull origin master --allow-unrelated-histories
 * User: 86187
 * Date: 2022-05-07
 * Time: 20:59
 */

//Scanner scan = new Scanner(System.in);

import java.util.Scanner;

public class TestDemo4 {
    public static String myToString(int[] array) {
        if(array == null) {
            return "[]";
        }
        String str = "[";
        for (int i = 0; i < array.length; i++) {
            str += array[i];
            if(i != array.length - 1) {
                str += ",";
            }
        }
        str += "]";
        return str;
    }

    public static void main(String[] args) {
        int[] array = {5,2,0,1,3,1,4};

        System.out.println(myToString(array));
    }
}
